//常规配置
module.exports = {
	publicPath: './',
	outputDir: 'dist',
	assetsDir: '',
	indexPath: "index.html",
	filenameHashing: true,
	pages: {
		index: {
			entry: 'src/main.js',
			template: 'public/index.html',
			filename: 'index.html',
			title: '蜂蜜柚子猴的网站',
			chunks: ['chunk-vendors', 'chunk-common', 'index']
		}
	},
	runtimeCompiler: false,
	devServer: {
		compress: true,
		port: 9999,
		host: '0.0.0.0',
		hot: true,
		open: true,
		proxy: {
			'/DH': {
				target: 'https://ecpassport.ceair.com',
				ws: true,
				changeOrigin: true,
				pathRewrite: {
					'^/DH': ''
				}
			}
		},
		before(app, server, compiler) {
			let str = "抢亚索兄弟们"
			app.get("/interface", function(req, res, next) {
				res.json({
					data: str
				})
			})
		}
	},
	configureWebpack: {
		externals: {
			"AMap": "AMap"
		}
	}
}
